//
//  Foo.m
//  RandomApp
//
//  Created by KaiKai on 11-6-8.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "Foo.h"


@implementation Foo

- (IBAction)generate:(id)sender
{
	int generated = (int)(random() % 100) + 1;
	NSLog(@"generated = %d", generated);
	
	[textField setIntValue:generated];
}

- (IBAction)seed:(id)sender
{
	srandom((unsigned)time(NULL));
	
	[textField setStringValue:@"Generator seedes"];
}

- (void)awakeFromNib
{
	NSCalendarDate *now;
	now = [NSCalendarDate calendarDate];
	[textField setObjectValue:now];
}

@end
